package 牛客网_N.动态规划.unique_paths_6;

import java.util.Scanner;

/**
 * 机器人走方格
 * @author x
 * @summary
 */
public class Main {
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		int m = in.nextInt();
		int n = in.nextInt();
		System.out.println(uniquePaths(m,n));
		in.close();
	}
	
	public static int uniquePaths(int m, int n){
        int[][] dp = new int[m+2][n+2];
		for(int i = 1; i < m+1; i++){
			dp[i][1] = 1;
		}
		for(int i = 1; i < n+1; i++){
			dp[1][i] = 1;
		}
		
		for(int i = 2; i < m+1; i++){
			for(int j = 2; j < n+1; j++){
				dp[i][j] = dp[i][j-1]+dp[i-1][j];
			}
		}
		return dp[m][n];
	}
}
